package com.shycloud.mido.member.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shycloud.mido.member.api.entity.MemberOpinion;
import com.shycloud.mido.member.mapper.MemberOpinionMapper;
import com.shycloud.mido.common.core.util.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import lombok.AllArgsConstructor;
import springfox.documentation.annotations.ApiIgnore;

@RestController
@AllArgsConstructor
@RequestMapping("/memberOpinion")
@ApiIgnore
public class MemberOpinionController {
    
    private final MemberOpinionMapper memberOpinionMapper;

    @GetMapping("/list")
    public R list(){
        QueryWrapper queryWrapper = new QueryWrapper<>();
        return new R<>(memberOpinionMapper.selectList(queryWrapper));
    }

    @GetMapping("/page")
    public R page(Page<MemberOpinion> page, String phone, String startDate, String endDate){
        return new R<>(memberOpinionMapper.page(page, phone, startDate, endDate));
    }
}
